<div class="doc-item" id="doc-1180"><h2 class="doc-item-name">print-stack-trace<span class="namespace">(clojure.contrib.stacktrace)</span></h2><ul class="var-arglists"><li>(<span class="var-name">print-stack-trace</span>  tr)</li><li>(<span class="var-name">print-stack-trace</span> tr n)</li></ul><div class="var-docstring"><p>Prints a Clojure-oriented stack trace of tr, a Throwable.
  Prints a maximum of n stack frames (default: unlimited).
  Does not print chained exceptions (causes).</p></div><div class="var-source"><pre>; clojure/contrib/stacktrace.clj:43
(defn print-stack-trace
  ([tr] (print-stack-trace tr nil))
  ([tr n]
     (let [st (.getStackTrace tr)]
       (print-throwable tr)
       (newline)
       (print &quot; at &quot;) 
       (print-trace-element (first st))
       (newline)
       (doseq [e (if (nil? n)
		   (rest st)
		   (take (dec n) (rest st)))]
	 (print &quot;    &quot;)
	 (print-trace-element e)
	 (newline)))))</pre></div><div class="license"><p>Copyright (c) Rich Hickey. All rights reserved.</p><p>The use and distribution terms for this software are covered by the <a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License 1.0</a>, which can be found in the file
          epl-v10.html at the root of this distribution. By using this software
          in any fashion, you are agreeing to be bound by the terms of this
          license. You must not remove this notice, or any other, from this
          software.</p></div></div>